﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TodoApp.ResultModel;
using Volo.Abp.Application.Services;

namespace TodoApp.TMS_material.MaterialsProcurements
{
    public class TMS_ProcurementAppService: ApplicationService
    {
        private readonly ITMS_ProcurementAppRepository _tMS_ProcurementAppRepository;
        public TMS_ProcurementAppService(ITMS_ProcurementAppRepository tMS_ProcurementAppRepository)
        {
            _tMS_ProcurementAppRepository = tMS_ProcurementAppRepository;
        }
        
        #region 物资采购显示分页查询
        public async Task<PageResponse<TMS_MaterialsProcurementDto>> GetAllProcurement(string MaterialsName, int MaterialsIPS, string productionPlace_PName, string pName, int MaterialsState, int pageindex = 1, int pagesize = 5)
        {
            return await _tMS_ProcurementAppRepository.GetAllProcurement(MaterialsName, MaterialsIPS, productionPlace_PName, pName, MaterialsState, pageindex, pagesize);
        }
        #endregion

        #region 物资管理删除
        public async Task<int> DeleteContracts(string id)
        {

            return await _tMS_ProcurementAppRepository.DeleteContracts(id);
        }
        #endregion

        #region 物资管理批量删除
        public async Task<int> DeleteSContracts(string ids)
        {

            return await _tMS_ProcurementAppRepository.DeleteSContracts(ids);
        }
        #endregion

        #region 物资采购添加
        public async Task<int> CreateProcurement(TMS_MaterialsProcuremenDto info)
        {

            return await _tMS_ProcurementAppRepository.CreateProcurement(info);

        }
        #endregion

        #region 物资管理修改
        public async Task<int> UpdateProcurement(TMS_MaterialsProcuremenDto info)
        {
            return await _tMS_ProcurementAppRepository.UpdateProcurement(info);
        }
        #endregion
    }
}
